import request from '@/request/request.js'

const PREFIX = '/admin'

/**
 * 获取轮播列表
 * @returns {*}
 * @param searchData
 */
export const getBanner = (searchData) => request(`${PREFIX}/getBanner`, searchData, 'get')

/**
 * 根据id获取轮播
 * @param id
 * @returns {Promise | Promise<unknown> | *}
 */
export const getBannerById = (id) => request(`${PREFIX}/getBannerById/${id}`)

/**
 * 添加轮播
 * @param data 表单数据
 * @returns {*}
 */
export const addBanner = (data) => request(`${PREFIX}/addBanner`, data, 'post')


/**
 * 修改轮播
 * @param data 表单数据
 * @returns {*}
 */
export const updateBanner = (data) => request(`${PREFIX}/updateBanner`, data, 'post')

/**
 * 删除轮播
 * @param id id
 * @returns {*}
 */
export const deleteBanner = (id) => request(`${PREFIX}/deleteBanner/${id}`)
